@echo off
chcp 65001
set "scriptDir=%~dp0"
cd /d "%scriptDir%"
cd stl
if exist build (
    powershell -Command "Write-Host '删除旧build目录...' -ForegroundColor Yellow"
    rd /s /q build
)
cd ../lexanalyze
if exist build (
    powershell -Command "Write-Host '删除旧build目录...' -ForegroundColor Yellow"
    rd /s /q build
)
cd ../grammar
if exist build (
    powershell -Command "Write-Host '删除旧build目录...' -ForegroundColor Yellow"
    rd /s /q build
)
cd LL1/tools
if exist build (
    powershell -Command "Write-Host '删除旧build目录...' -ForegroundColor Yellow"
    rd /s /q build
)
cd /d "%scriptDir%"
cd lexanalyze
if exist "lexanalyze.exe" (
    powershell -Command "Write-Host '删除lexanalyze.exe...' -ForegroundColor Yellow"
    del "lexanalyze.exe"
)
if exist "shared_memory.dat" (
    powershell -Command "Write-Host '删除shared_memory.dat...' -ForegroundColor Yellow"
    del "shared_memory.dat"
)
cd ../grammar
if exist "ll1.exe" (
    powershell -Command "Write-Host '删除ll1.exe...' -ForegroundColor Yellow"
    del "ll1.exe"
)
if exist "opg.exe" (
    powershell -Command "Write-Host '删除opg.exe...' -ForegroundColor Yellow"
    del "opg.exe"
)
if exist "lr0.exe" (
    powershell -Command "Write-Host '删除lr0.exe...' -ForegroundColor Yellow"
    del "lr0.exe"
)
pause